<?php
require 'init.php';
$id = $_POST['id'];
$admin = $_POST['admin'];
$isDel = $db -> query("SELECT * FROM `newsinfo` WHERE `id` = '$id' AND `admin` = '$admin'") -> fetch_assoc();
if(is_null($isDel)){
    echo json_encode([
        'code'=>201,
        'msg'=>'删除失败'
    ]);
}else{
    $db -> query("UPDATE `newsinfo` SET `isdelete` = '1' WHERE `id` = '$id' AND `admin` = '$admin'");
    echo json_encode([
    'code' => 200,
    'msg' => '删除成功'
    ]);
}

?>